import Home from '../views/Home'
import About from '../views/About'
import Detail from '../views/Detail'
import Parent from '../views/Parent'
import News from '../views/News'
import Article from '../views/Article'
import City from '../views/City'
import {Redirect} from "react-router-dom";
const routes=[
    {
        path:'/',
        exact:true,
        render:()=><Redirect to="/home"></Redirect>
    },
    {
        path:'/home',
        name:'Home',
        component:Home
    },
    {
        path:'/about',
        name:About,
        component:About,
        children:[
            {
                path:'/about',
                exact:true,
                render:()=><Redirect to="/about/news"></Redirect>
            },
            {
                path:'/about/news',
                component:News
            },
            {
                path:'/about/article',
                component:Article
            }
        ]
    },
    {
        path:'/detail/:id',
        name:Detail,
        component:Detail
    },
    {
        path:'/parent',
        component:Parent
    },
    {
        path:'/city',
        component:City
    }
]
export default routes